I am trying to create tags based on aws documentation where I need to add tag key with the name of the aws eks cluster.
const eksCluster = eks
.createCluster({
version: "1.21",
name: `${deployment.name}-eks-cluster`,
resourcesVpcConfig: {
securityGroupIds: [eksSgDefault.GroupId],
subnetIds: [
subnetprivOne.Subnet.SubnetId,
subnetprivTwo.Subnet.SubnetId,
],
endpointPublicAccess: true,
publicAccessCidrs: ["XXXX/X"],
},
roleArn: "arn:aws:iam::XXXXXXXX:role/Management-EKS",
tags: [
{
"cluster-name": `${deployment.name}-eks-cluster`,
[`kubernetes.io/cluster/${deployment.name}-eks-cluster`]: "owned",
},
],
})
.promise();
When running this I get Expected params.tags['0'] to be a string. Which means I am somehow failing with this lane:
[`kubernetes.io/cluster/${deployment.name}-eks-cluster`]: "owned",
Did anyone tried to solve this ?